{include file="/wap/public/top" /}
{include file="/wap/public/layui" /}<link rel="stylesheet" type="text/css" href="__indexwap__/css/userf.css">
<div class="user_zx_right">
<div class="box">
<div class="tagMenu">
{include file="/wap/public/zlxgtop" /}
<div class="hite"> <span id="account"></span> </div>
</div>
</div>
<div class="myinfo" style="padding:0px  20px; margin-bottom: 15px;background:#fff;">
<p style="margin-:15px;">您可以通过经常性修改登录密码更好的保护您的账号安全，以避免您受到意外损失</p>
<p style="margin-:15px;">1、经常性修改登录密码能有效的保护您的帐号安全</p>
<p style="margin-:15px;">2、涉及到您的资金安全，请勿设置简单的登录密码，不要设置和其它网站相同的登录密码</p>
<form action="" id=" theForm" method="post">
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" style="margin-top:10px;" height="90">
<tbody><tr height="40">
<td width="197" align="right" style="background:#F9F9F9;border-top:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px;border-right:#e6e6e6 solid 1px;">会员账号：</td>
<td width="528" style="border-right:#e6e6e6 solid 1px;border-top:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px; padding-left:5px;">{$user.name}</td>
</tr>
<tr height="60">
<td style="background:#F9F9F9;border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px;border-right:#e6e6e6 solid 1px;" align="right">原始交易密码：</td>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px; padding-left:5px;"><input type="password" name="oldpwd" id="oldpwd" style="width:200px; height:40px; line-height:40px; border-radius: 15px; border:#CCCCCC solid 1px; padding:0px 8px;"></td>
</tr>
<tr height="60">
<td style="background:#F9F9F9;border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px;border-right:#e6e6e6 solid 1px;" align="right">新交易密码：</td>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px; padding-left:5px;"><input type="password" name="newpwd" id="newpwd" style="width:200px; height:40px; line-height:40px; border-radius: 15px; border:#CCCCCC solid 1px; padding:0px 8px;"> (输入您的新密码)</td>
</tr>
<tr height="60">
<td style="background:#F9F9F9;border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px;border-right:#e6e6e6 solid 1px;" align="right">请再输入新密码：</td>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px; padding-left:5px;"><input type="password" name="pwd2" id="pwd2" style="width:200px; height:40px; line-height:40px; border-radius: 15px; border:#CCCCCC solid 1px; padding:0px 8px;"> (再输入一次您的新密码)</td>
</tr>
<tr height="60">
<td style="border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px;border-right:#e6e6e6 solid 1px;" align="right">手机验证码：</td>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px; padding-left:5px;">

	<input type="text" name="yzm" id="yzm" style="width:60px; height:40px; line-height:40px; border-radius: 15px; border:#CCCCCC solid 1px; padding:0px 8px;" maxlength="6"> 
	<a style="background:#ff6600;padding:5px; color:#FFFFFF; font-size:14px;" id="jq_send" >获取手机验证码</a> </td>
</tr>
<tr height="50">
<td style="border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px;border-right:#e6e6e6 solid 1px;" align="right"></td>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px; color:#ff9600; padding-left:3px;">  <input id="sub" type="button" value="提交更新" class="btnsubupdate"> <input type="button" value="&nbsp;&nbsp;取消&nbsp;&nbsp;" class="btncancel" onclick="location.href=location.href;" id="btn_cancel"></td>
</tr>
</tbody></table>
</form>
</div>
</div>
<script>
$(function(){
 function loginsubmit(){
	
                var oldpwd=true;
                var newpwd=true;
				var pwd2=true;
               


                if($('#oldpwd').val() == ''){
                    msg("原密码不能为空");
                    $('#oldpwd').focus();
                    oldpwd = false;
                    return false;
                }

                if($('#newpwd').val() == ''){
                    msg("新密码不能为空");
                    $('#newpwd').focus();
                    newpwd = false;
                    return false;
                }
				 if($('#pwd2').val() == ''){
                    msg("确认密码不能为空");
                    $('#theForm input[name=pwd2]').focus();
                    pwd2 = false;
                    return false;
                }
				if($('#pwd2').val() != $('#newpwd').val()){
                   msg("2次密码不一致");
                    $('#newpwd').focus();
                    pwd2 = false;
					 $('#pwd2').focus();
                    newpwd = false;
                    return false;
                }
           
		   if($('#yzm').val() ==''){
                   msg("验证码不能为空");
                    $('#yzm').focus();
                    
                    
                    return false;
                }
               

                if( $('#theForm input[name=oldpwd]').val() != '' && $('#theForm input[name=newpwd]').val() != ''){
                    $.ajax({
                        async:false,
                        url:"{:url('user/pwd2up')}",
                        data:{'oldpwd':$('#oldpwd').val(),'newpwd':$('#newpwd').val(),'pwd2':$('#pwd2').val(),'yzm':$('#yzm').val()},
                        type:'post',
                        dataType:'json',
                        success:function(res){
							console.log(res);
                            if(res.status != 1){
                                msg(res.msg);
                               
                               
                                return false;
                            }else{
								msg(res.msg);
                            setTimeout(function(){window.location.reload();},2000);
                            }
							if(res.url){
							setTimeout(function(){window.location.href=res.url},2000);
							}
                        },
                        error : function(XMLHttpRequest, textStatus, errorThrown) {
							console.log(XMLHttpRequest);
                            $('#error').html('<span class="error">网络失败，请刷新页面后重试!</span>');
                        }
                    });
                }else{
                    return false;
                }
            }

           
            $('#sub').on('click',function(){
				
                loginsubmit();
            });
			
			
           
			
        });
</script>
 <script type="text/javascript">
        var mobile_timeout;
        var mobile_count = 100;
        var mobile_lock = 0;
        $(function () {
            $("#jq_send").click(function () {
				
                if (mobile_lock == 0) {
                    mobile_lock = 1;
                    $.post("{:url('sendsms/sendsms')}",{mobile:'{$user.mobile}'},function(data){
						
                        if(data.status == 'success'){
							
                            mobile_count = 60;
                           msg("发送成功");
                           $('#yzm').val(data.num);
                            BtnCount();
                        }else{
							msg("发送失败");
                            mobile_lock = 0;
                           
                        }
                    },'json');

					return false;
                }

            });

			
        });
		
        function BtnCount () {
            if (mobile_count == 0) {
                $('#jq_send').html("重新发送"); $("#jq_send").attr('disabled',false);
                mobile_lock = 0;
                clearTimeout(mobile_timeout);
            }
            else {
                mobile_count--;
				 $("#jq_send").attr('disabled',true);
                $('#jq_send').html("重新发送(" + mobile_count.toString() + ")秒");
                mobile_timeout = setTimeout(BtnCount, 1000);
            }
        };
    </script>
{include file="/wap/public/hder" /}